def method(a: list):
    t_max = a[0]
    b = []
    for i in range(len(a)):
        if t_max > a[i]:
            dis = t_max - a[i]
            b.append(dis)
        else:
            t_max = a[i]
            b.append(0)
    return b 


if __name__ == '__main__':
    _ = input()
    a = [int(x) for x in input().split(' ')]
    b = method(a)
    b = ' '.join(list(map(str, b)))
    print(b)
